package com.sy.workflow.core.engine.cfg;



import com.sy.workflow.core.engine.Context;
import com.sy.workflow.core.engine.core.ServiceContext;
import com.sy.workflow.core.engine.impl.SimpleContext;
import com.sy.workflow.core.engine.parser.impl.CustomParser;
import com.sy.workflow.core.engine.parser.impl.DecisionParser;
import com.sy.workflow.core.engine.parser.impl.EndParser;
import com.sy.workflow.core.engine.parser.impl.ForkParser;
import com.sy.workflow.core.engine.parser.impl.JoinParser;
import com.sy.workflow.core.engine.parser.impl.StartParser;
import com.sy.workflow.core.engine.parser.impl.TaskParser;
import com.sy.workflow.core.engine.parser.impl.WfSubProcessParser;


/**
 *
 * 流程引擎配置类
 * @author mldong
 * @date 2022/6/12
 */
public class Configuration {
    public Configuration() {
        this(new SimpleContext());
    }
    public Configuration(Context context) {
        ServiceContext.setContext(context);
        ServiceContext.put("decision", DecisionParser.class);
        ServiceContext.put("end", EndParser.class);
        ServiceContext.put("fork", ForkParser.class);
        ServiceContext.put("join", JoinParser.class);
        ServiceContext.put("start", StartParser.class);
        ServiceContext.put("task", TaskParser.class);
        ServiceContext.put("custom",CustomParser.class);
        ServiceContext.put("wfSubProcess", WfSubProcessParser.class);
    }

}
